﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="GoodsType.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <!--#include virtual="include/Head.ascx"-->
    <script type="text/javascript" language="javascript">
        function doDelete(strID) {
            if (confirm('Bạn có thực sự muốn xóa')) {
                var vnpage = getUrlVars()['page_number'];
                if (vnpage)
                    window.location.href = "GoodsType.aspx?action=delete&ID=" + strID + "&page_number=" + vnpage;
                else
                    window.location.href = "GoodsType.aspx?action=delete&ID=" + strID;
            }
        }

        function getUrlVars() {
            var vars = [], hash;
            var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
            for (var i = 0; i < hashes.length; i++) {
                hash = hashes[i].split('=');
                vars.push(hash[0]);
                vars[hash[0]] = hash[1];
            }
            return vars;
        }
    </script>
</head>
<body>
    <div id="body-wrapper">
        <div id="header">
            <!--#include virtual="include/Top.ascx"-->
        </div>
        <div id="main-content1">
            <h2>
                LIST TYPE
            </h2>
            <div class="clear">
            </div>
            <form id="frmEdit" runat="server" method="post">
            <div class="content-box" style="width: 40%">
                <div style="height: auto; padding: 7px;">
                    <asp:DropDownList ID="ddCode" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddCode_Selected">
                    </asp:DropDownList>
                    <asp:DropDownList ID="ddName" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddName_Selected"
                        Width="200px">
                    </asp:DropDownList>
                </div>
                <div class="content-box-header">
                    <h3 style="cursor: s-resize;">
                        Goods &nbsp;&nbsp;<asp:Label ID="lblError" runat="server" CssClass="msg-error"></asp:Label>
                    </h3>
                    <div class="clear">
                    </div>
                </div>
                <asp:Repeater ID="rptData" runat="server">
                    <ItemTemplate>
                        <tr onmouseover="this.style.background='#dbf0c9'" onmouseout="this.style.background='#ffffff'">
                            <td>
                                <%# DataBinder.Eval(Container.DataItem, "Index")%>
                            </td>
                            <td>
                                <asp:HiddenField ID="txtID" runat="server" Value='<%# DataBinder.Eval(Container.DataItem, "ID")%>'>
                                </asp:HiddenField>
                                <asp:TextBox ID="txtTen" runat="server" Text=' <%# DataBinder.Eval(Container.DataItem, "Ten") %>'
                                    Width="95%"></asp:TextBox>
                            </td>
                            <td align="right">
                                <asp:TextBox ID="txtMa" runat="server" Text=' <%# DataBinder.Eval(Container.DataItem, "Ma") %>'
                                    Width="95%" Style="text-align: right"></asp:TextBox>
                            </td>
                            <td align="center">
                                <%# DataBinder.Eval(Container.DataItem, "Action")%>
                            </td>
                        </tr>
                    </ItemTemplate>
                    <HeaderTemplate>
                        <table cellspacing="0" cellpadding="0" width="100%" border="0" class="adminlist">
                            <thead>
                                <tr>
                                    <th align="center" class="thheader" width="40px">
                                        INDEX
                                    </th>
                                    <th align="center" class="thheader">
                                        NAME
                                    </th>
                                    <th align="center" class="thheader">
                                        CODE
                                    </th>
                                    <th>
                                        #
                                    </th>
                                </tr>
                            </thead>
                    </HeaderTemplate>
                    <FooterTemplate>
                        </TABLE>
                    </FooterTemplate>
                </asp:Repeater>
                <div class="clear">
                </div>
                <div style="margin-top: 5px; width: 100%">
                    <asp:Button ID="btnSave" runat="server" Text="Update" class="button" OnClick="btnSave_Click" />
                </div>
                <div class="clear">
                </div>
            </div>
            <div id="footer" style="width: 40%;">
                <%=strPager%>
            </div>
            </form>
        </div>
    </div>
</body>
</html>
